package org.wak.action
{
	import org.wak.action.actions.AdventureActions;
	import org.wak.action.actions.BaseAction;
	import org.wak.action.actions.CloseAction;
	import org.wak.action.actions.GiveAction;
	import org.wak.action.actions.InteractAction;
	import org.wak.action.actions.LookAtAction;
	import org.wak.action.actions.OpenAction;
	import org.wak.action.actions.PickUpAction;
	import org.wak.action.actions.PullAction;
	import org.wak.action.actions.PushAction;
	import org.wak.action.actions.TalkToAction;
	import org.wak.action.actions.UseAction;
	import org.wak.action.actions.WalkToAction;
	
	/**
	 * Actions Factory class 
	 * 
	 */	
	public class ActionsFactory
	{
		
		public function ActionsFactory()
		{
		}
		
		public static function CreateAction(pActionId:String):BaseAction
		{
			var fNewAction:BaseAction = null ;
			
			switch(pActionId)
			{
				case AdventureActions.ActionIdGive :
					fNewAction = new GiveAction();
				break ;
				case AdventureActions.ActionIdOpen :
					fNewAction = new OpenAction();
				break ;
				case AdventureActions.ActionIdClose :
					fNewAction = new CloseAction();
				break ;
				
				case AdventureActions.ActionIdPickUp :
					fNewAction = new PickUpAction();
				break ;
				case AdventureActions.ActionIdLookAt:
					fNewAction = new LookAtAction();
				break ;
				case AdventureActions.ActionIdTalkTo :
					fNewAction = new TalkToAction();
				break ;
				
				case AdventureActions.ActionIdUse:
					fNewAction = new UseAction();
				break ;
				case AdventureActions.ActionIdPush :
					fNewAction = new PushAction();
				break ;
				case AdventureActions.ActionIdPull :
					fNewAction = new PullAction();
				break ;
				
				case AdventureActions.ActionIdWalkTo :
					fNewAction = new WalkToAction();
				break ;
				
				case AdventureActions.ActionIdInteract :
					fNewAction = new InteractAction();
				break ;
				
				default:
					throw new Error("ActionsFactory: Unknown action "+ pActionId);
			}
			return fNewAction ;
		}

	}
}